Skip to contents

Replace a term in a model specification

Usage

replace_term(spec, old, new)

Arguments

spec

A model_spec object.

old

Character string naming the term to replace.

new

Character string naming the replacement term.

Value

A new model_spec with the term swapped in-place.

Examples

base_m <- model_spec(cyl, disp, hp)
replace_term(base_m, "disp", "wt")
#> model_spec: ~ cyl + wt + hp